package rs.domain;

import rs.util.CanonicalString;

/* Classe che rappresenta un brano */
public class Track {
	
	private String name;
	private String artist;
	
	public Track(String name, String artist) {
		this.name = new CanonicalString(name).toString();
		this.artist = new CanonicalString(artist).toString();
	}

	public String getName() {
		return this.name;
	}

	public String getArtist() {
		return this.artist;
	}
	
	public int hashCode() {
		return this.artist.hashCode() + this.name.hashCode();
	}
	
	public boolean equals(Object o) {
		Track t = (Track) o;
		return t.getName().equals(this.getName()) && t.getArtist().equals(this.artist);
	}
	
}
